/*
Copyright (C) 2009  Raymond Jeon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef __GL_LIB_DIR_H__
#define __GL_LIB_DIR_H__


#include <string.h>
#include <stdlib.h>
#include "gl_lib_linklist.h"




#define LIST_STOP		-1
#define LIST_PASS		0
#define LIST_GO			1


typedef int		GLLISTRET;


void GlDirMakePath(char *szFile);
BOOL GlDirCreate(char *szDir);
BOOL GlDirExist(char* szDir);
BOOL GlDirCheckAndCreate(char* szDir);
BOOL GlDirReCreate(char* szDir);
BOOL GlDirMove(char *src_dir, char *des_dir);
BOOL GlDirRemove(char *dir);
BOOL GlDirScan(char *szDir, char *wildcard, GLLISTRET (*scan_func)(), void *s1, void *s2, void *s3);
gllink_ *GlDirScanGetDir(char *szDir);
gllink_ *GlDirScanGetFile(char *szDir, char *wildcard);
gllink_ *GlDirScanGetFileMax(char *szDir, char *wildcard, int iMax);

BOOL GlDirValCheck(char *szDir);
void GlDirJustSlash(char *szDir);

long GlDirGetSize(char *dir);
BOOL GlDirEmpthy(char *dir);
void GlCleanExpiredFile(char *szDir, int iDay);

#endif	// __GL_LIB_DIR_H__




